Performance improvements and content poster embed migration#193
Open
user1303836 wants to merge 5 commits intomainfrom
Open
Performance improvements and content poster embed migration#193user1303836 wants to merge 5 commits intomainfrom
user1303836 wants to merge 5 commits intomainfrom
Conversation
Pipeline performance: - Concurrent source fetching with asyncio.gather and Semaphore(5) - Batch content_items_exist query replaces per-item existence checks - Batch get_sources_by_ids replaces per-item source lookups in summarize_pending and backfill Content poster: - Switch from plain text messages to Discord embeds with structured formatting - Add summary truncation that preserves bullet point boundaries Substack adapter: - Deduplicate by extending RSSAdapter directly RSS discovery: - Concurrent path probing for faster RSS feed detection
Add Discord autocomplete handlers for /source remove, /source info, /source toggle, /github remove, and /github toggle commands. Filters suggestions by guild and matches on partial name input.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
asyncio.gather+Semaphore(5)for parallel fetching, significantly reducing total poll cycle time_fetch_source(content existence checks),summarize_pending(source lookups), and_handle_first_posting_backfill(source lookups) by using batch operationsChanges
Pipeline performance (
pipeline.py,repository.py)content_items_exist()batch method to Repository (singleINquery vs N individual queries)content_item_exists()calls with batch lookup in_fetch_sourceget_source_by_id()calls withget_sources_by_ids()insummarize_pendingand_handle_first_posting_backfill_is_due_for_poll()helper and_fetch_source_safe()error wrapperasyncio.gatherandSemaphore(5)Content poster (
content_poster.py,content_posting.py)format_message()withformat_embed()returningdiscord.Embed_truncate_summary_at_bullet()to cleanly truncate summaries at bullet boundariespost_content()to send embeds instead of plain textAdapters (
substack.py,rss_discovery.py)asyncio.gatherTest plan
ruff check .passesruff format --check .passesmypy src/passescontent_items_existbatch method@greptile